import React, {Component} from 'react'
import { Route } from 'react-router-dom'

import ERPLayout from '../../Layout/erp'
import One from './One/One';
import Two from './Two/Two';
import Three from './Three/Three'

import './index.scss'
class Home extends Component {
  constructor (props) {
    super(props)
  }
  async linkTo (url) {
    await (() => 11)
    this.props.history.push(`/home/${url}`)
  }
  render () {
    return (
      <ERPLayout>
        <h1>首页</h1>
        <ul className='nav'>
          <li onClick={() => this.linkTo('one')}>子路一</li>
          <li onClick={() => this.linkTo('two')}>子路二</li>
          <li onClick={() => this.linkTo('three')}>子路三</li>
        </ul>
        <Route component={One} path="/home/one"></Route>
        <Route component={Two} path="/home/two"></Route>
        <Route component={Three} path="/home/three"></Route>
      </ERPLayout>
    )
  }
}

export default Home